package com.yami.shop.im.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.im.bean.ImRecord;
import com.yami.shop.im.param.SysUserParam;
import com.yami.shop.im.vo.Conversation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ImRecordMapper extends BaseMapper<ImRecord> {

    List<ImRecord> listHistory(@Param("shopId") Long shopId, @Param("userId") String userId, @Param("size") Integer size, @Param("sendType") Integer sendType);

    List<Conversation> listConversationByUserId(@Param("userId") String userId, @Param("maxDay") Integer maxDay);

    void updateToRead(@Param("userId") String userId, @Param("shopId") Long shopId, @Param("source") int source, @Param("sendType") int sendType);

    List<Conversation> listConversationByShopId(@Param("shopId") Long shopId, @Param("maxDay") Integer maxDay, @Param("sendType") int sendType);

    SysUserParam getLatelyUser( @Param("maxDay") Integer maxDay,@Param("userId") String userId);
}
